module.exports = app => {
    const { STRING, INTEGER, TEXT, DATE, BIGINT } = app.Sequelize;

    const Job = app.model.define('job', {
        job_id: {
            type: BIGINT.UNSIGNED,
            primaryKey: true,
            autoIncrement: true,
        },
        publisher_id: { type: BIGINT.UNSIGNED, allowNull: false },
        title: { type: STRING(100), allowNull: false },
        company: { type: STRING(100), allowNull: false },
        location: { type: STRING(100), allowNull: false },
        description: { type: STRING(255), allowNull: false },
        requirements: { type: STRING(255), allowNull: false },
        salary_range: { type: STRING(50), allowNull: false },
        created_at: DATE,
        expires_at: DATE,
    }, {
        tableName: 'jobs',
        timestamps: false,
    });

    return Job;
};